<template>
  <PractionsContent :tabData="data" :isShow="false" ref="target"/>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "MediaCache",
});
</script>

<script setup lang="ts">
import {onMounted, ref } from "vue";
//引入自定义hooks
import useLazyData from "@/hooks/useLazyData";
import PractionsContent from "../components/PractionsContent.vue";
import { getMediaCacheDataRequest } from "@/api/practice";
import type {tabDataItemType} from '../model/type'

const tabData = ref<tabDataItemType[]>([
  {
    label: "资源",
    name: "first",
    content:[],
  },
  {
    label: "视频课",
    name: "second",
    content: [],
  },
  {
    label: "直播课",
    name: "fourth",
    content: [],
  },
]);


//请求数据方法
// const getMediaCacheData = async () => {
//   const res = await getMediaCacheDataRequest()

//   tabData.value[0].content = res.content
// }

// onMounted(() => {
//   //初始化获取数据
//   getMediaCacheData()
// })


const {data, target} = useLazyData(getMediaCacheDataRequest, tabData.value)
</script>
